package com.java.gamePackeg.event;

import com.java.exer_6.Event;
import com.java.exer_6.Player;
import com.java.exer_6.Product;

import javax.swing.*;
import java.util.List;

public class CityBeRod implements Event {
    private static final float BE_ROD = 0.1f;
    private static final float HOSPITAL_USE = 0.1f;

    @Override
    public void event(Player player, List<Product> marketProList) {
        JOptionPane.showMessageDialog(null, "路过街边小巷，遇到些混混看俺就一个人就把俺打了，临走还抢了俺的钱，俺被送进了医院，村长骂骂咧咧地垫付俺的医药费。");
        player.setMoney(Math.round(player.getMoney() * BE_ROD));
        player.setDebt(Math.round(player.getDebt() + player.getMoney() * HOSPITAL_USE));
    }


}